package org.hdax.dm.rest.service;

import org.hdax.dm.dao.entitydao.DmOrderLinkUserDao;
import org.hdax.dm.entity.order.DmOrderLinkUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RestDmOrderLinkUserService {

    @Autowired
    private DmOrderLinkUserDao dmOrderLinkUserDao;

    @PostMapping(path = "/addOrderLinkUser")
    public void addOrderLinkUser(@RequestBody DmOrderLinkUser orderLinkUser){
        dmOrderLinkUserDao.save(orderLinkUser);
    }

    @PostMapping(path = "/delLinkUser")
    public void delLinkUser(@RequestParam("orderNo")Long orderNo){
        dmOrderLinkUserDao.deleteByOrderId(orderNo);
    }
}
